<?php

//
// +------------------------------------------------------------------------+
// | PHP Version 5.4                                                        |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | 世纪车来车往(北京）网络科技有限公司 版权所有！                                  |
// | TEL:010-63732365  HOTLINE:400-6688-365  EMAIL:clcw@clcw.com.cn         |
// | $Revision: 1.0 $                                                     |
// +------------------------------------------------------------------------+
// | Author: anguolei@clcw.com.cn                                           |
// +------------------------------------------------------------------------+
//
/**
 * 检测调度
 */

namespace AuctionBack\Controller;

use AuctionCore\CarOwner\Owner;
use AuctionCore\CarResource\Car;
use AuctionCore\CarOwner\OwnerList as OwnerList;
use AuctionCore\Account\Back\Employee;

class DetectSchedulingController extends BaseController {
    public function __construct() {
        parent::__construct();
    }

    /**
     * 待分配
     */
    public function index() {
        $this->display();
    }

    /**
     * 待分配列表
     */
    public function distribute_list() {
        $page = I("get.p", 1);
        $size = 10;
        $params = array();
        $params['status'] = I("get.status");
        $params['reserve_start_time'] = I("get.start_time");
        $params['reserve_end_time'] = I("get.end_time");
        $params['owner_id'] = I("get.owner_id");
        $params['seller_name'] = I("get.seller_name");
        $params['phone'] = I("get.phone");
        $params['reserve_area'] = I("get.area");
        $params['reserve_city'] = I("get.city");
        $params['reserve_province'] = I("get.province");
        $params['trace_type'] = -1;
        $params['location_area'] = I('get.location_area');
        if(!$params['location_area']){
            $params['location_area'] = !$this->is_hq?array_flip($this->bc_city):array();
        }
        $params['tab'] = 1;
        $order = 'modify_time DESC';
        //获取list
        $ol = new OwnerList();
        $result = $ol->getList($page, $size, $params, $order);
        $Page = new \AuctionCore\Common\AjaxPage($result['total'], $size, "get_page");
        $Page->setConfig('theme', " %totalRow% %header% %nowPage%/%totalPage% 页 %first% %upPage% %prePage% %linkPage% %downPage% %nextPage% %end% %jumpform%");
        $show = $Page->show(); // 分页显示输出
        $this->assign('page', $show); // 赋值分页输出
        $this->assign('list', $result['list']);
        $this->assign("business_status", C("BUSINESS_STATUS"));
        $this->assign('channel_type', C("CHANNEL_TYPE"));
        $this->assign("params", $params);
        $this->display();
    }

    /**
     * 待检测
     */
    public function detect() {
        //$checkers = \AuctionCore\Account\Back\Employee::get_emp_by_group_or_store(382);
        $checkers = \AuctionCore\Account\Back\Employee::get_branch_emp(C('APPRAISER.0'),$this->user_info['branch_id']);
        $this->assign("checker", $checkers);
        $this->display();
    }

    /**
     * 待检测列表
     */
    public function detect_list() {
        $page = I("get.p", 1);
        $size = 10;
        $params = array();
        $params['status'] = I("get.status");
        $params['reserve_start_time'] = I("get.start_time");
        $params['reserve_end_time'] = I("get.end_time");
        $params['owner_id'] = I("get.owner_id");
        $params['seller_name'] = I("get.seller_name");
        $params['phone'] = I("get.phone");
        $params['reserve_area'] = I("get.area");
        $params['reserve_city'] = I("get.city");
        $params['reserve_province'] = I("get.province");
        $params['checker_id'] = I("get.checker_id");
        $params['location_area'] = I('get.location_area');
        if(!$params['location_area']){
            $params['location_area'] = !$this->is_hq?array_flip($this->bc_city):array();
        }
        $order = 'modify_time DESC';
        //获取list
        $ol = new OwnerList();
        $result = $ol->getList($page, $size, $params, $order);
        $Page = new \AuctionCore\Common\AjaxPage($result['total'], $size, "get_page");
        $Page->setConfig('theme', " %totalRow% %header% %nowPage%/%totalPage% 页 %first% %upPage% %prePage% %linkPage% %downPage% %nextPage% %end% %jumpform%");
        $show = $Page->show(); // 分页显示输出
        $this->assign('page', $show); // 赋值分页输出
        $this->assign('list', $result['list']);
        $this->assign("business_status", C("BUSINESS_STATUS"));
        $this->assign('channel_type', C("CHANNEL_TYPE"));
        $this->assign("params", $params);
        $this->display();
    }

    /**
     * 检测成功
     */
    public function success() {
        //$checkers = \AuctionCore\Account\Back\Employee::get_emp_by_group_or_store(382);
        $checkers = \AuctionCore\Account\Back\Employee::get_branch_emp(C('APPRAISER.0'),$this->user_info['branch_id']);
        $this->assign("checker", $checkers);
        $this->display();
    }

    /**
     * 检测成功列表
     */
    public function success_list() {
        $page = I("get.p", 1);
        $size = 10;
        $params = array();
        $params['status'] = I("get.status");
        $params['check_date_start'] = I("get.start_time");
        $params['check_date_end'] = I("get.end_time");
        $params['owner_id'] = I("get.owner_id");
        $params['seller_name'] = I("get.seller_name");
        $params['phone'] = I("get.phone");
        $params['checker_id'] = I("get.checker_id");
        $params['location_area'] = I('get.location_area');
        if(!$params['location_area']){
            $params['location_area'] = !$this->is_hq?array_flip($this->bc_city):array();
        }
        $order = 'check_date DESC';
        //获取list
        $ol = new OwnerList();
        $result = $ol->getList($page, $size, $params, $order);
        $Page = new \AuctionCore\Common\AjaxPage($result['total'], $size, "get_page");
        $Page->setConfig('theme', " %totalRow% %header% %nowPage%/%totalPage% 页 %first% %upPage% %prePage% %linkPage% %downPage% %nextPage% %end% %jumpform%");
        $show = $Page->show(); // 分页显示输出
        $this->assign('page', $show); // 赋值分页输出
        $this->assign('list', $result['list']);
        $this->assign("business_status", C("BUSINESS_STATUS"));
        $this->assign('channel_type', C("CHANNEL_TYPE"));
        $this->assign("params", $params);
        $this->display();
    }

    /**
     * 检测失败
     */
    public function fail() {
        //$checkers = \AuctionCore\Account\Back\Employee::get_emp_by_group_or_store(382);
        $checkers = \AuctionCore\Account\Back\Employee::get_branch_emp(C('APPRAISER.0'),$this->user_info['branch_id']);
        $this->assign("checker", $checkers);
        $this->display();
    }

    /**
     * 检测失败列表
     */
    public function fail_list() {
        $page = I("get.p", 1);
        $size = 10;
        $params = array();
        $params['status'] = I("get.status");
        $params['check_start_time'] = I("get.start_time");
        $params['check_end_time'] = I("get.end_time");
        $params['owner_id'] = I("get.owner_id");
        $params['seller_name'] = I("get.seller_name");
        $params['checker_id'] = I("get.checker_id");
        $params['phone'] = I("get.phone");
        $params['fail_type'] = I('get.fail_type');
        $params['location_area'] = I('get.location_area');
        if(!$params['location_area']){
            $params['location_area'] = !$this->is_hq?array_flip($this->bc_city):array();
        }
        $order = 'modify_time DESC';

        //获取list
        $ol = new OwnerList();
        $result = $ol->getList($page, $size, $params, $order);
        $Page = new \AuctionCore\Common\AjaxPage($result['total'], $size, "get_page");
        $Page->setConfig('theme', " %totalRow% %header% %nowPage%/%totalPage% 页 %first% %upPage% %prePage% %linkPage% %downPage% %nextPage% %end% %jumpform%");
        $show = $Page->show(); // 分页显示输出
        $this->assign('page', $show); // 赋值分页输出
        $this->assign('list', $result['list']);
        $this->assign("business_status", C("BUSINESS_STATUS"));
        $this->assign('channel_type', C("CHANNEL_TYPE"));
        $this->assign("params", $params);
        $this->display();
    }

    /**
     * 滞留
     */
    public function retention() {
        $this->display();
    }

    public function retention_list() {
        $page = I("get.p", 1);
        $size = 10;
        $params = array();
        $params['status'] = I("get.status");
        $params['reserve_start_time'] = I("get.start_time");
        $params['reserve_end_time'] = I("get.end_time");
        $params['owner_id'] = I("get.owner_id");
        $params['seller_name'] = I("get.seller_name");
        $params['phone'] = I("get.phone");
        $params['reserve_area'] = I("get.area");
        $params['reserve_city'] = I("get.city");
        $params['reserve_province'] = I("get.province");
        $params['location_area'] = I('get.location_area');
        if(!$params['location_area']){
            $params['location_area'] = !$this->is_hq?array_flip($this->bc_city):array();
        }
        $params['tab'] = 5;
        $order = 'modify_time DESC';
        //获取list
        $ol = new OwnerList();
        $result = $ol->getList($page, $size, $params, $order);
        $Page = new \AuctionCore\Common\AjaxPage($result['total'], $size, "get_page");
        $Page->setConfig('theme', " %totalRow% %header% %nowPage%/%totalPage% 页 %first% %upPage% %prePage% %linkPage% %downPage% %nextPage% %end% %jumpform%");
        $show = $Page->show(); // 分页显示输出
        $this->assign('page', $show); // 赋值分页输出
        $this->assign('list', $result['list']);
        $this->assign("business_status", C("BUSINESS_STATUS"));
        $this->assign('channel_type', C("CHANNEL_TYPE"));
        $this->assign("params", $params);
        $this->display();
    }

    public function shedulingList() {
        $page = I("get.p", 1);
        $size = 10;
        $params = array();
        $params['status'] = I("get.status");
        $params['reserve_start_time'] = I("get.start_time");
        $params['reserve_end_time'] = I("get.end_time");
        $params['owner_id'] = I("get.owner_id");
        $params['seller_name'] = I("get.seller_name");
        $params['phone'] = I("get.phone");
        $params['reserve_area'] = I("get.reserve_area");
        $params['reserve_city'] = I("get.reserve_city");
        $params['reserve_provinc'] = I("get.reserve_provinc");
        $params['fail_type'] = I('get.fail_type');
        $params['location_area'] = I('get.location_area');
        if(!$params['location_area']){
            $params['location_area'] = !$this->is_hq?array_flip($this->bc_city):array();
        }
        $order = 'modify_time DESC';
        //获取list
        $ol = new OwnerList();
        $result = $ol->getList($page, $size, $params, $order);
        $Page = new \AuctionCore\Common\AjaxPage($result['total'], $size, "get_page");
        $Page->setConfig('theme', " %totalRow% %header% %nowPage%/%totalPage% 页 %first% %upPage% %prePage% %linkPage% %downPage% %nextPage% %end% %jumpform%");
        $show = $Page->show(); // 分页显示输出
        $this->assign('page', $show); // 赋值分页输出
        $this->assign('list', $result['list']);
        $this->assign("business_status", C("BUSINESS_STATUS"));
        $this->assign('channel_type', C("CHANNEL_TYPE"));
        $this->assign("params", $params);
        $this->display();
    }

    //分配
    public function distribute() {
        $owner_id = I("get.id", 0);
        $o = new Owner($owner_id);
        $owner = $o->detail();
        $addr = new \AuctionCore\Other\Address();
        $province = $addr->get_name_by_code($owner['reserve_province']);
        $city = $addr->get_name_by_code($owner['reserve_city']);
        $area = $addr->get_name_by_code($owner['reserve_address']);
        //$owner['address'] = $province . " " . $city . " " . $area . " " . $owner['reserve_address'];
        //根据不同服务方式 显示地址
        $owner['location_area'] = $owner['location_area'] ? $addr->get_name_by_code($owner['location_area']) : "北京";
        if ($owner['service_method'] == 2) {
            $province = $addr->get_name_by_code($owner['reserve_province']);
            $city = $addr->get_name_by_code($owner['reserve_city']);
            $area = $addr->get_name_by_code($owner['reserve_area']);
            $owner['address'] = $province . " " . $city . " " . $area . " " . $owner['reserve_address'];
        } elseif ($owner['service_method'] == 3) {
            //门店
            $store = new \AuctionCore\Other\Store();
            $map = array();
            $map['store_id'] = array('eq',$owner['reserve_store']);
            $stores = $store->detail($map);
            $owner['address'] = $stores['store_name'];

        } else {
            $owner['address'] = "未知";
        }
        $owner['mileage'] = round($owner['mileage']/10000,2);
        /**
         * 车辆信息
         */
        $car_info = Car::get_car_by_owner_id($owner['owner_id']);
        $cm = new \AuctionCore\CarResource\CarModel();
        $brand = $cm->get_model_by_id($car_info['brand_id'], 'brand');
        $series = $cm->get_model_by_id($car_info['series_id'], 'series');
        $model = $cm->get_model_by_id($car_info['model_id']);
        $car_info['car_model'] = $brand['name'] . ' ' . $series['name'] . ' ' . $model['name'];
        $car_info['reg_city'] = $addr->get_name_by_code($car_info['reg_city']);

        $server = Employee::user_info_id($owner['service_id']);
        $owner['server'] = $server['real_name'];
        $owner['owner_type_name'] = C('OWNER_TYPE_NAME')[$owner['owner_type']];
        /**
         * 如果有退单
         */
        $condition['owner_id'] = $owner_id;
        $condition['fail_type'] = 4;
        $car_check_log = M('car_check_log')->where($condition)->select();
        $car_check_data = array();
        foreach ($car_check_log as $k => $v) {
            $checker = Employee::user_info_id($v['checker_id']);
            $car_check_data[$k]['checker'] = $checker['real_name'];
            $car_check_data[$k]['createtime'] = date("Y年m月d日 H:i", strtotime($v['createtime']));
            $car_check_data[$k]['remark'] = $v['remark'];
        }

        //-----------------选择评估师
        $branch_id = $this->user_info['branch_id'];
        $appraiser = C('APPRAISER');
        $all_depart = \AuctionCore\Account\Back\Employee::get_branch_depart($appraiser[0],$branch_id);
        $all_depart = explode(',',$all_depart['all_depart']);
        if ($branch_id == 0) {
            $branch_id = 1;
        }
        $new_arr[] = M('depart')->field('id,pid,name')->where(array('id'=>$branch_id))->find();
        $departs = \AuctionCore\Account\Back\Department::get_father_depart($all_depart,$branch_id,$new_arr);
        // $checkers = Employee::get_emp_by_group_or_store($delivery_advisor[0],0,$branch_id);

        //
        $this->assign('departs', $departs);
        $this->assign("car_check_log", $car_check_data);
        $this->assign("owner", $owner);
        $this->assign("car", $car_info);
        $this->display();
    }
    //根据部门id找到对应角色人员
    public function get_checker() {
        $depart_id = I("request.depart_id");
        if ($depart_id < 1) {
            $this->helpJsonResult(500, '部门id不能为空');
        }
        $appraiser = C('APPRAISER');
        $checkers = \AuctionCore\Account\Back\Employee::get_depart_emp($appraiser[0],$depart_id);
        // var_dump($checkers);
        if (empty($checkers)) {
            $this->helpJsonResult(500, 'empty');
        }
        $this->helpJsonResult(200, 'checker list', $checkers);
    }


    /**
     * 再次分配时改为调度处理中状态
     */
    public function distribute_again() {
        $again = I('get.again');
        $this->assign("again",$again);
        $this->distribute();
    }

    //保存分配信息
    public function saveDistribution() {
        $owner_id = I("post.owner_id/d");
        $again = I('post.again');
        if ($owner_id < 1) {
            $this->helpJsonResult(400, "用户ID错误");
        }
        $fenpei_type = I("post.fenpei_type/d");
        if ($fenpei_type == 2) {            //滞留
            $remark_fail = I('post.assgin_remark_zl');
            if (empty($remark_fail)) {
                $this->helpJsonResult(500, "请填写滞留备注");
            }
            $data['trace_type'] = 3;
            $data['business_status'] = 2;
            $data['delay_status'] = 1;
            $car_check_type = 7;
            $data['remark_fail'] = $remark_fail;
            $action_msg = '滞留';
            $data['check_fail_type'] = 0;
        } elseif ($fenpei_type == 3) {      //改约
            $remark_fail = I('post.assgin_remark_gy');
            if (empty($remark_fail)) {
                $this->helpJsonResult(500, "请填写改约备注");
            }
            $data['trace_type'] = 1;
            $data['business_status'] = 2;
            $data['check_fail_type'] = 5;
            $car_check_type = 6;
            $data['remark_fail'] = $remark_fail;
            $action_msg = '改约';
            if($again == 1){
                $data['delay_status'] = 0; 
                $data['trace_type'] = 1; 
            }
        } else {                      //分配成功
            $data['checker_id'] = I("post.checker_id/d");
            $data['is_assigned'] = 1;
            $data['assgin_remark'] = I("post.assgin_remark");
            if (empty($data['checker_id'])) {
                $this->helpJsonResult(500, "请选择评估师");
            }
            $action_msg = '分配';
            $car_check_type = 5;
            if($again == 1){
                $data['business_status'] = 4;
                $data['delay_status'] = 0; 
                $data['trace_type'] = 0; 
            }
            $action = $data['checker_id'];
        }
        $owner = new Owner($owner_id);
        $result = $owner->update($data);
        if (!$result) {
            $prompt_msg = $action_msg . '失败';
            $this->helpJsonResult(500, $prompt_msg);
        }
        $prompt_msg = $action_msg . '成功';
        /**
         * 车辆检测调度跟踪日志
         */
//        $createtime = date("Y-m-d H:i:s", time());
//        $employee = M("employee")->find($this->user_info['emp_id']);
//        $car_check_tarce_log = array(
//            'createtime' => $createtime,
//            'car_check_trace_msg' => $prompt_msg,
//            'employee' => $employee['real_name']
//        );
//        $owner->add_car_check_trace_log($car_check_tarce_log);
//        
        /**
         * 记录车辆检测调度日志
         */
        $car_check_trace['owner_id'] = $owner_id;
        $car_check_trace['emp_id'] = $this->user_info['emp_id'];
        $car_check_trace['type'] = $car_check_type;
        Owner::save_reserve_log($car_check_trace);

        //记录员工操作日志
        $log = array(
            'emp_id' => $this->user_info['emp_id'],
            'order_id' => 0,
            'car_id' => 0,
            'owner_id' => $owner_id,
            'action' => "检测调度-分配" . $action
        );
        \AuctionCore\System\SystemLog::add($log);

        $this->helpJsonResult(200, $prompt_msg);
    }

    //待检测,检测成功,检测失败查看信息
    public function detection() {
        $owner_id = I("get.id", 0);
        $o = new Owner($owner_id);
        $owner = $o->detail();
        //根据不同服务方式 显示地址
        $addr = new \AuctionCore\Other\Address();
        $owner['location_area'] = $owner['location_area'] ? $addr->get_name_by_code($owner['location_area']) : "北京";

        if ($owner['service_method'] == 2) {
            $province = $addr->get_name_by_code($owner['reserve_province']);
            $city = $addr->get_name_by_code($owner['reserve_city']);
            $area = $addr->get_name_by_code($owner['reserve_area']);
            $owner['address'] = $province . " " . $city . " " . $area . " " . $owner['reserve_address'];
        } elseif ($owner['service_method'] == 3) {
            //门店
            $store = new \AuctionCore\Other\Store();
            $map = array();
            $map['store_id'] = array('eq',$owner['reserve_store']);
            $stores = $store->detail($map);
            $owner['address'] = $stores['store_name'];
        } else {
            $owner['address'] = "未知";
        }

        if ($owner['business_status'] == 5) {
            $car_info = Car::get_car_by_owner_id($owner['owner_id']);
            $cm = new \AuctionCore\CarResource\CarModel();
            $brand = $cm->get_model_by_id($car_info['brand_id'], 'brand');
            $series = $cm->get_model_by_id($car_info['series_id'], 'series');
            $model = $cm->get_model_by_id($car_info['model_id']);
            $car_info['car_model'] = $brand['name'] . ' ' . $series['name'] . ' ' . $model['name'];
            $car_info['reg_city'] = $addr->get_name_by_code($car_info['reg_city']);
        }
        $car_info['location_area'] = $addr->get_name_by_code($car_info['location_area']);
        $car_info['pointer_mileage'] = formatMileage($car_info['pointer_mileage']);
        $server = Employee::user_info_id($owner['service_id']);
        $checker = Employee::user_info_id($owner['checker_id']);
        $owner['server'] = $server['real_name'];
        $owner['checker'] = $checker['real_name'];
        $owner['owner_type_name'] = C('OWNER_TYPE_NAME')[$owner['owner_type']];
        $owner['mileage'] = formatMileage($owner['mileage']);
        $this->assign("owner", $owner);
        $this->assign("car", $car_info);
        $condition['owner_id'] = $owner_id;
        $condition['fail_type'] = $owner['check_fail_type'];
        $car_check_log = M('car_check_log')->where($condition)->find();
        $this->assign('car_check_log', $car_check_log);
        $this->display();
    }

    //检测成功报告
    public function report() {
        $owner_id = I("get.id/d", 0);
        if ((int) $owner_id < 1) {
            $this->helpJsRedirect("车主ID信息错误");
        }
        $o = new Owner($owner_id);
        $ownerInfo = $o->detail();
        $carInfo = Car::get_car_by_owner_id($owner_id);
        if (empty($carInfo)) {
            $this->helpJsRedirect("未查询到车辆信息");
        }
        //获取车辆检测报告
        $Rep = A('CarReport');
        $report = $Rep->output_report($carInfo['car_id']);
        $car = new Car($carInfo['car_id']);
        $procedure = $car->detail('car_procedure');
        $this->assign('report', $report);
        $this->assign('car', $carInfo);
        $this->assign('procedure', $procedure);
        $this->display();
    }

    //获取评估师
    public function getCheckers() {
        $store_id = I("request.store_id/d", 0);
        if ($store_id < 1) {
            $this->helpJsonResult(200, '门店信息错误');
        }
        $checkers = \AuctionCore\Account\Back\Employee::get_emp_by_group_or_store(382, $store_id);
        if (empty($checkers)) {
            $this->helpJsonResult(500, 'empty');
        }
        $this->helpJsonResult(200, 'checker list', $checkers);
    }

    /**
     * 再分配状态
     */
    public function distributeAgain() {
        $owner_id = I('post.owner_id');
        if ($owner_id < 1) {
            $this->helpJsonResult(400, "用户ID错误");
        }
        $owner = new Owner($owner_id);
        $detail = $owner->detail();
        if ($detail['business_status'] == 2 && $detail['delay_status'] == 2) {
            $this->helpJsonResult(500, "客服处理中，不可再分配！");
        } elseif ($detail['business_status'] == 3 && $detail['delay_status'] == 3) {
            $this->helpJsonResult(500, "客服处理为预约失败，不可再分配！");
        }
        $data['delay_status'] = 4;
        $res = $owner->update($data);
        if (!$res) {
            $this->helpJsonResult(500, "再分配失败");
        }
        $this->helpJsonResult(200, "再分配成功");
    }

    /**
     * 弹出再预约则为处理中
     */
    public function reserveIng() {
        $owner_id = I("post.owner_id/d");
        if ($owner_id < 1) {
            $this->helpJsonResult(400, "用户ID错误");
        }

        $ow = new Owner($owner_id);
        $owner_info = $ow->detail();
        if($owner_info['delay_status']!=3 && $owner_info['delay_status']!=6){
            $this->helpJsonResult(400,'请等待客服处理完成');
        }
        $data['delay_status'] = 6;   //再预约处理中状态
        $owner = new Owner($owner_id);
        $res = $owner->update($data);
        if (!$res) {
            $this->helpJsonResult(500, "再预约处理失败");
        }
        $this->helpJsonResult(200, 'success');
    }

    /**
     * 再预约功能，再预约处理完成改状态为调度处理完成
     * 刚成为滞留的时候未处理状态可再分配,只要客服处理中待分配变为灰色不能点，
     * 客服处理出结果，结果为继续跟踪则可以显示再预约，处理到失败则直接消失;
     */
    public function reserveAgain() {
        $owner_id = I("post.owner_id/d");
        if ($owner_id < 1) {
            $this->helpJsonResult(400, "用户ID错误");
        }
        $remark = trim(I('post.remark'));
        if (empty($remark)) {
            $this->helpJsonResult(400, "请填写再预约信息");
        }
        $data['reserve_reminder'] = $remark;
        $data['delay_status'] = 5;          //处理完成
        $owner = new Owner($owner_id);
        $res = $owner->update($data);
        if (!$res) {
            $this->helpJsonResult(500, "再预约失败");
        }

        //记录日志
        $logs = array(
            'owner_id' => $owner_id,
            'emp_id' => $this->user_info['emp_id'],
            'type'=> 8,
            'remark'=>$remark
        );
        Owner::save_reserve_log($logs);
        $this->helpJsonResult(200, "再预约成功");
    }

}
